package cn.yanhu.kuwanapp.my.adapter

import cn.woochen.comlib.adapter.CommonRecyclerAdapter
import cn.woochen.comlib.util.ext.setOnSingleClickListener
import cn.yanhu.kuwanapp.R
import cn.yanhu.kuwanapp.bean.response.RespGameListBean
import cn.yanhu.kuwanapp.bean.response.RespTaskListBean
import cn.yanhu.kuwanapp.databinding.ItemEarnGameListBinding
import cn.yanhu.kuwanapp.databinding.ItemMySmallGameBinding
import cn.yanhu.kuwanapp.databinding.ItemMyTaskBinding
import com.lz.aiwan.littlegame.bean.GameModel
import com.lz.aiwan.littlegame.utils.LzLittleGame

/**
 *
 * 类描述：
 * @author：woochen
 * create at：2021/7/28 7:19 AM
 */
class MySmallGameAdapter(datas: List<GameModel>) :
        CommonRecyclerAdapter<GameModel>(datas, R.layout.item_my_small_game) {

    override fun convert(holder: ViewHolder, item: GameModel) {
        holder.getDataBinding<ItemMySmallGameBinding?>()?.let {
            it.itemBean = item
            it.tvOpenGame.setOnSingleClickListener {
                LzLittleGame.getInstance().openGameByGid(mContext, item.gid)
            }
        }
    }
}